<%@ taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh">
<!--<![endif]-->
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>

<head>
    <meta charset="utf-8"/>
    <%@include file="../common/taglib.jsp" %>
    <title>保险代理后台管理系统</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
    <meta content="" name="description"/>
    <meta content="" name="author"/>
    <!-- ================== BEGIN BASE CSS STYLE ================== -->
    <jsp:include page="../common/header.jsp"></jsp:include>
    <style>
        body {
            background: #fff
        }

        .control-label {
            width: 154px;
        }
    </style>
</head>
<body>
<section>
    <ul class="nav nav-pills">
        <li class="active"><a href="#tab1" data-toggle="tab">保单信息</a></li>
        <li><a href="#tab2" data-toggle="tab">应付信息</a></li>
        <li><a href="#tab3" data-toggle="tab">应收信息</a></li>
        <li><a href="#tab4" data-toggle="tab">退保信息</a></li>
        <li><a href="#tab5" data-toggle="tab">附件</a></li>
    </ul>
    <div class="form-wrap">
        <input type="text" id="tabType" value="${tabType}" hidden>
        <div class="tab-content">
            <div id="tab1" class="tab-pane fade active in">
                <h4>投保客户信息</h4>
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">保单号：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">
                                <c:choose>
                                    <c:when test="${orderInfo.ordNum == null || orderInfo.ordNum == ''}">
                                        待生成保单号
                                    </c:when>
                                    <c:otherwise>${orderInfo.ordNum}</c:otherwise>
                                </c:choose>
                            </p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">车主：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.carOwner}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">车牌号：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.plateNum}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">车架号：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.engineNum}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">车辆种类：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">
                                <c:choose>
                                    <c:when test="${orderInfo.vehicleType == 1}">客车</c:when>
                                    <c:when test="${orderInfo.vehicleType == 2}">货车</c:when>
                                </c:choose>
                            </p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">被保险人：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.insurant}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">被保险人身份证号/<br>组织机构代码：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.orgIdCode}</p>
                        </div>
                    </div>
                </div>
                <h4>保险信息</h4>
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">保险公司：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.insyrerName}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">险种：</label>
                        <div class="col-sm-10">
                            <c:choose>
                                <c:when test="${orderInfo.typeInsurance==0}">
                                    <p class="form-control-static">交强险</p>
                                </c:when>
                                <c:when test="${orderInfo.typeInsurance==1}">
                                    <p class="form-control-static">商业险</p>
                                </c:when>
                            </c:choose>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">保单生效日期：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.datePolicy}到${orderInfo.expireDate}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">垫资类型：</label>
                        <div class="col-sm-10">
                            <c:choose>
                                <c:when test="${orderInfo.typeInsurance2==1}">
                                    <p class="form-control-static">不垫资</p>
                                </c:when>
                                <c:when test="${orderInfo.typeInsurance2==2}">
                                    <p class="form-control-static">垫返点</p>
                                </c:when>
                                <c:when test="${orderInfo.typeInsurance2==3}">
                                    <p class="form-control-static">垫保费</p>
                                </c:when>
                            </c:choose>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">垫子期限：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.laonAccount} 天</p>
                        </div>
                    </div>
                    <c:choose>
                        <c:when test="${orderInfo.typeInsurance==0 }">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">交强险保费：</label>
                                <div class="col-sm-10">
                                    <p class="form-control-static">${orderInfo.pulsoryPremium} 元</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">车船税：</label>
                                <div class="col-sm-10">
                                    <p class="form-control-static">${orderInfo.vechcleVesselTax} 元</p>
                                </div>
                            </div>
                        </c:when>
                        <c:when test="${orderInfo.typeInsurance==1 }">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商业险保费：</label>
                                <div class="col-sm-10">
                                    <p class="form-control-static">${orderInfo.mercialPremium} 元</p>
                                </div>
                            </div>
                        </c:when>
                    </c:choose>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">保险公司返点：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.followPoint+orderInfo.replenishPoint} %</p>
                        </div>
                    </div>
                </div>
                <h4>费用合计</h4>
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">全保费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.allPremium}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">渠道应支付保费合计：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${channelRecord.mustPremium}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">保险公司跟单手续费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${companyRecord.followRpoundage}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">保险公司补单手续费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${companyRecord.replenishRpoundage}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">税后保费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.texPremium}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">渠道返点：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.channelRebate}%</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">渠道返佣费合计：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${channelRecord.mustRebateAmt}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">付款主体：</label>
                        <div class="col-sm-10">
                            <c:choose>
                                <c:when test="${orderInfo.paySubject ==1 }">
                                    <p class="form-control-static">环宇康泰</p>
                                </c:when>
                                <c:when test="${orderInfo.paySubject ==2 }">
                                    <p class="form-control-static">青岛盛达</p>
                                </c:when>
                                <c:when test="${orderInfo.paySubject ==3 }">
                                    <p class="form-control-static">玉环天云</p>
                                </c:when>
                                <c:when test="${orderInfo.paySubject ==4 }">
                                    <p class="form-control-static">汉龙</p>
                                </c:when>
                            </c:choose>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">出单员：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${saleman.username}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">出单日期：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.dateIssuance}</p>
                        </div>
                    </div>
                </div>
            </div>
            <div id="tab2" class="tab-pane fade">
                <h4>应付保险公司</h4>
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">收取渠道金额：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${channelRecord.realPremium}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">收款日期：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${channelRecord.receiptDate}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">付保险公司金额：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${companyRecord.realPremium}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">付保险公司日期：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${companyRecord.payDate}</p>
                        </div>
                    </div>
                </div>
                <h4>应付渠道</h4>
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">应付返佣费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${channelRecord.mustRebateAmt}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">实付返佣费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${channelRecord.realRebateAmt}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">付返佣费日期：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${channelRecord.payDate}</p>
                        </div>
                    </div>
                </div>
            </div>
            <div id="tab3" class="tab-pane fade">
                <h4>应收保险公司</h4>
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">税后保费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.texPremium}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">跟单点位：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.followPoint}%</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">补单点位：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.replenishPoint}%</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">跟单手续费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${companyRecord.followRpoundage}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">补单手续费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${companyRecord.replenishRpoundage}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">核对结果：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">
                                <c:choose>
                                    <c:when test="${companyRecord.checkResult == 0}">未核对</c:when>
                                    <c:when test="${companyRecord.checkResult == 1}">一致</c:when>
                                    <c:when test="${companyRecord.checkResult == 2}">不一致</c:when>
                                </c:choose>
                            </p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">核对时间：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${companyRecord.checkDate}</p>
                        </div>
                    </div>
                    <c:if test="${companyRecord.checkPremiumResult == 2}">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">核对税后保费：</label>
                            <div class="col-sm-10">
                                <p class="form-control-static">${companyRecord.checkPremium}元</p>
                            </div>
                        </div>
                    </c:if>
                    <c:if test="${companyRecord.chechFollowResult == 2}">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">核对跟单点位：</label>
                            <div class="col-sm-10">
                                <p class="form-control-static">${companyRecord.chechFollowRpoundage}%</p>
                            </div>
                        </div>
                    </c:if>
                    <c:if test="${companyRecord.checkReplenishResult == 2}">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">核对补点点位：</label>
                            <div class="col-sm-10">
                                <p class="form-control-static">${companyRecord.checkReplenishRpoundage}%</p>
                            </div>
                        </div>
                    </c:if>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">是否开票：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">
                                <c:choose>
                                    <c:when test="${companyRecord.isTicketOpen==0}">未开票</c:when>
                                    <c:when test="${companyRecord.isTicketOpen==1}">已开票</c:when>
                                </c:choose>
                            </p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">开票时间：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${companyRecord.ticketOpenTime}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">收保险公司手续费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">
                                <c:if test="${companyRecord.status == 5}">
                                    ${companyRecord.realRebateAmt}元
                                </c:if>
                            </p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">实收跟单手续费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">
                                <c:if test="${companyRecord.status == 5}">
                                    ${companyRecord.realFollowRpoundage}元
                                </c:if>
                            </p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">实收补单手续费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">
                                <c:if test="${companyRecord.status == 5}">
                                    ${companyRecord.realReplenishRpoundage}元
                                </c:if>
                            </p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">收款时间：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${companyRecord.receiptDate}</p>
                        </div>
                    </div>
                </div>
                <h4>应收渠道</h4>
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">应收渠道保费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${channelRecord.mustPremium}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">账期到账日：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.insyrerMaturityDate}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">实收渠道保费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${channelRecord.realPremium}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">收款时间：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${channelRecord.receiptDate}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">渠道收费来源：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">
                                <c:choose>
                                    <c:when test="${channelRecord.capitalSourcr == 1}">正常结算</c:when>
                                    <c:when test="${channelRecord.capitalSourcr == 1}">保证金</c:when>
                                </c:choose>
                            </p>
                        </div>
                    </div>
                </div>
            </div>
            <div id="tab4" class="tab-pane fade">
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">退保日期：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${orderInfo.surrenderDate}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">退保保险公司扣除手续费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${unsureRecord.payInsurerAmt}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">退保应扣渠道佣金：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${unsureRecord.mustRebateAmt}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">退保渠道应还保费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${unsureRecord.mustPremium}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">渠道退保结算佣金：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${unsureRecord.realRebateAmt}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">渠道退保结算保费：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${unsureRecord.realPremium}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">退保渠道扣费来源：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">
                                <c:choose>
                                    <c:when test="${unsureRecord.capitalSourcr == 1}">正常结算</c:when>
                                    <c:when test="${unsureRecord.capitalSourcr == 1}">保证金</c:when>
                                </c:choose>
                            </p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">退保结算日期：</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${unsureRecord.receiptDate}</p>
                        </div>
                    </div>
                </div>
            </div>
            <div id="tab5" class="tab-pane fade">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>附件名称</th>
                        <th>附件内容</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${attachList}" var="attach">
                        <tr>
                            <td>${attach.typeName}</td>
                            <td><a onclick="fileOpen('${attach.url}')">查看</a></td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</section>

<table class="bg-warning">
    <thead>
        <tr>
            <th>操作记录</th>
            <th>操作人</th>
            <th>操作时间</th>
            <th>备注</th>
        </tr>
    </thead>
    <tbody>
    <c:forEach items="${optionList}" var="opt">
        <tr>
            <td>${opt.content}</td>
            <td>${opt.createUser.roleName}(${opt.createUser.realName})</td>
            <td><javatime:format value="${opt.createAt}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <td>${opt.remark}</td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<!-- end page container -->
<jsp:include page="../common/footer.jsp"/>
<script type="text/javascript">
    $(document).ready(function () {
        App.init();
        TableManageFixedHeader.init();
        var tabType = $("#tabType").val();
        parent.controlTabShow(tabType);
    });
    window.onload=function(){
        var s = parent.document.getElementById('iframeParent');
        var $tabPane=$('.tab-pane');

        function setIframeHeight(){
            s.style.height =document.body.offsetHeight+'px';
        }

        setIframeHeight();

        $(".nav").find("li").click(function (){
            var $index=$(this).index();
            $tabPane.eq($index).addClass('aa')
            setTimeout(function (){
                if($tabPane.eq($index).hasClass('active')){
                    setIframeHeight();
                }
            },200);
        });
    }
    window.onload=function(){
        var s = parent.document.getElementById('iframeParent');
        var $tabPane=$('.tab-pane');

        function setIframeHeight(){
            s.style.height =document.body.offsetHeight+'px';
        }

        setIframeHeight();

        $(".nav").find("li").click(function (){
            var $index=$(this).index();
            $tabPane.eq($index).addClass('aa')
            setTimeout(function (){
                if($tabPane.eq($index).hasClass('active')){
                    setIframeHeight();
                }
            },200);
        });
    }
    function fileOpen(url) {
        window.open(url);
    }
</script>
<!-- ================== END PAGE LEVEL JS ================== -->
</body>
</html>


<%--<div class="form-horizontal">
    <div class="form-group">
        <label class="col-sm-2 control-label">车主：</label>
        <div class="col-sm-2">
            <p class="form-control-static">${orderInfo.carOwner}</p>
        </div>
        <label class="col-sm-2 control-label">车主：</label>
        <div class="col-sm-2">
            <p class="form-control-static">${orderInfo.carOwner}</p>
        </div>
        <label class="col-sm-2 control-label">车主：</label>
        <div class="col-sm-2">
            <p class="form-control-static">${orderInfo.carOwner}</p>
        </div>
    </div>
</div>--%>
